<div class="boxed">
    <div id="content-container">
        <div id="page-title">
            <h1 class="page-header text-overflow">Data Tables</h1>
            <div class="searchbox">
                <div class="input-group custom-search-form">
                    <input type="text" class="form-control" placeholder="Search..">
                    <span class="input-group-btn">
                        <button class="text-muted" type="button"><i class="demo-pli-magnifi-glass"></i></button>
                    </span>
                </div>
            </div>
        </div>
        <ol class="breadcrumb">
            <li><a href="{:url('Admin/Index/index')}">首页</a></li>
            <li>陪玩控制台</li>
            <li class="active">用户管理</li>
        </ol>
        <div id="page-content">
            <div class="panel">
                <div class="panel-heading">
                    <h3 class="panel-title">
                        {foreach name="status" id="v"}
                        <button class="btn btn-primary">
                            <a class="ahref" href="/index.php/Admin/play/order?status={$v.id}">{$v.name}</a>
                        </button>
                        {/foreach}
                    </h3>
                </div>
                <div class="panel-body">
                    <table id="demo-dt-basic" class="table table-striped table-bordered" cellspacing="0" width="100%">
                        <thead>
                            <tr>
                                <th>ID</th>
                                <th>发起预约</th>
                                <th>预约玩家</th>
                                <th align="center">预约游戏</th>
                                <th align="center">开始时间</th>
                                <th align="center">预约订单</th>
                                <th align="center">游戏次数</th>
                                <th align="center">支付金额</th>
                                <th align="center">是否过期</th>
                                <th align="center">留言</th>
                                <th align="center">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {foreach name="list" id="v"}
                            <tr>
                                <td>{$v['bes_id']}</td>
                                <td>
                                    <a href="/index.php/Admin/user/indexUser?uid={$v.bes_myid}">
                                    <img class="r50" src="{$v.user_avatar}" width="30">
                                    {$v['user_nickname']}
                                    </a>
                                </td>
                                <td>
                                    <a href="/index.php/Admin/user/indexUser?uid={$v.bes_from}">
                                        <img class="r50" src="{$v.yours.user_avatar}" width="30">
                                        {$v.yours.user_nickname}
                                    </a>
                                </td>
                                <td>
                                    <a href="/index.php/Admin/user/indexUser?user_leavel={$v['game_id']}">
                                        <button class="btn btn-xs btn-default">
                                            <a href="/index.php/Admin/play/game?id={$v.game_id}">{$v.game_name}</a>
                                        </button>
                                    </a>
                                    </td>
                                <td>{$v['bes_starttime']}</td>
                                <td>
                                    <a href="/index.php/Admin/play/orders?id={$v['bes_order']}">{$v['bes_order']}</a>
                                </td>
                                <td>{$v['bes_number']}局</td>
                                <td>{$v['bes_pay']}豌豆</td>
                                <td>
                                    {switch name="$v.bes_status" }
                                    {case value="0"}
                                    <button class="btn btn-xs btn-danger">已过期 </button>
                                    {/case}
                                    {case value="1"}
                                    <button class="btn btn-xs btn-info">待接单 </button>
                                    {/case}
                                    {case value="3"}
                                     <button class="btn btn-xs btn-warning">待确认 </button>
                                    {/case}
                                    {case value="5"}
                                     <button class="btn btn-xs btn-info">待评价 </button>
                                    {/case}
                                    {case value="7"}
                                     <button class="btn btn-xs btn-success">已完成 </button>
                                    {/case}
                                    {default /}默认
                                    {/switch}
                                </td>
                                <td>{$v.bes_note||default='...'}</td>
                                <td>
                                    <button class="btn btn-xs btn-info">取消订单</button>
                                </td>
                            </tr>
                            {/foreach}
                        </tbody>
                    </table>
                    <div id="page" style="text-align:right">
                        {$pages}
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- 修改菜单模态框结束 -->
<script type="text/javascript">
    function bindConfig() {
        localStorage.setItem('editor','');
        layerBox.show('在线代码编辑器',['60%', '70%'],'/index.php/Admin/editor?ename=editor');
    }
    function saveEditor(value) {
        console.log(value);
        $.post('/index.php/Admin/play/game?act=edit', {value:value}, function(data) {
            layer.msg(data.msg,{time:3000},function () {
                if(data.code > 0){
                    EditorClose();
                    setTimeout(function () {
                        location.reload();
                    },200)
                }
            });
        });
    }
    function EditorClose() {
        layer.closeAll();
    }
</script>